import request from "@/utils/request"
import { addAccountParams, reqFindAllAccountParams, resAccountListItem, updateInfoParams } from "@/views/userFamily/type"

// 查看所有账号
export function reqfindAllAccountList(params: Partial<reqFindAllAccountParams>) {
    return request<resAccountListItem[]>({
        url: '/findAllAccount',
        method: 'post',
        data: params,
    })
}
// 根据id查账号
export function reqFindAccountById(params: { id: string }) {
    return request<resAccountListItem>({
        url: '/findAccountById',
        method: 'post',
        data: params,
    })
}
// 修改个人账号信息
export function reqUpdateOwnInfo(params: Partial<updateInfoParams>) {
    return request({
        url: '/updateMyAcc',
        method: 'post',
        data: params,
    })
}
// 新增账号
export function reqAddAccount(params: Partial<addAccountParams>) {
    return request({
        url: '/addAccount',
        method: 'post',
        data: params,
    })
}